FROM node:20.3.0 as builder
WORKDIR /app

COPY . /app
# COPY package.json /app
ENV TZ Asia/Shanghai

RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \
    && rm -rf pnpm-lock.yaml node_modules/ \
    && npm install pnpm -g \
    && pnpm install \
    && pnpm run build
# COPY . .
# RUN pnpm run build
# FROM nginx:latest
FROM nginx:1.21.6
COPY nginx.conf /etc/nginx
COPY --from=builder /app/dist  /usr/share/nginx/html
